package com.actdata.demo.controller;


import com.actdata.demo.model.User;
import com.actdata.demo.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author astupidcoder
 * @since 2021-01-12
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    public IUserService userService;
@RequestMapping("/show")
public String Show(){
    return "hello";
}
@RequestMapping("/getUser")
    public User getUserByid(){
        return userService.getById(1);
    }

    @RequestMapping("/getAllUser")
    public String getAllUser(){
        List<User> list = userService.findAllUser();
        return "helllo";
    }
}
